package com.cmsz.upay.constant;

import org.apache.hadoop.hive.serde.serdeConstants;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by le on 2017/12/18.
 */
public enum OnLineChargingColumnEnum {

    ACTIVITY_CODE("ACTIVITY_CODE", serdeConstants.DECIMAL_TYPE_NAME,"交易代码"),
    REQ_SYS("REQ_SYS", serdeConstants.STRING_TYPE_NAME,"发起方系统"),
    REQ_DATE("REQ_DATE", serdeConstants.STRING_TYPE_NAME,"发起方交易日期"),
    UPAY_BIZ_SEQ("UPAY_BIZ_SEQ", serdeConstants.STRING_TYPE_NAME,"统一支付流水号"),
    REQ_TRANS_ID("REQ_TRANS_ID", serdeConstants.STRING_TYPE_NAME,"发起方交易流水"),
    SESSION_ID("SESSION_ID", serdeConstants.STRING_TYPE_NAME,"DCC会话ID"),
    REQ_DATE_TIME("UPAY_BIZ_SEQ", serdeConstants.STRING_TYPE_NAME,"发起方时间戳"),
    ACTION_CODE("ACTION_CODE", serdeConstants.STRING_TYPE_NAME,"交易动作代码"),
    RCV_SYS("RCV_SYS", serdeConstants.STRING_TYPE_NAME,"接收方系统"),
    RCV_DATE("RCV_DATE", serdeConstants.STRING_TYPE_NAME,"接收方交易日期"),
    RCV_TRANS_ID("RCV_TRANS_ID", serdeConstants.STRING_TYPE_NAME,"接收方交易流水号"),
    RCV_DATE_TIME("RCV_DATE_TIME", serdeConstants.STRING_TYPE_NAME,"接收方时间戳"),
    MER_ID("MER_ID", serdeConstants.STRING_TYPE_NAME,"计费平台标识"),
    VAS_TYPE("VAS_TYPE", serdeConstants.STRING_TYPE_NAME,"咪咕业务平台类型"),
    PAY_TYPE("PAY_TYPE", serdeConstants.STRING_TYPE_NAME,"交易方式"),
    AMOUNT("AMOUNT", serdeConstants.STRING_TYPE_NAME,"交易金额"),
    HOME_PROV("HOME_PROV", serdeConstants.STRING_TYPE_NAME,"归属省代码"),
    CHARGE_NUMBER("CHARGE_NUMBER", serdeConstants.STRING_TYPE_NAME,"交易的用户号码"),
    TRADE_SEQNO("TRADE_SEQNO", serdeConstants.STRING_TYPE_NAME,"咪咕平台订单号"),
    TRADE_SESSION("TRADE_SESSION", serdeConstants.STRING_TYPE_NAME,"咪咕计费交易流水"),
    OLD_TRADE_SESSION("OLD_TRADE_SESSION", serdeConstants.STRING_TYPE_NAME,"旧交易流水"),
    SETTLE_DATE("SETTLE_DATE", serdeConstants.STRING_TYPE_NAME,"对账以此日期为准"),
    TRADE_TIME("TRADE_TIME", serdeConstants.STRING_TYPE_NAME,"交易时间"),
    OLD_SETTLE_DATE("OLD_SETTLE_DATE", serdeConstants.DECIMAL_TYPE_NAME,"旧交易对账日期"),
    OLD_TRADE_TIME("OLD_TRADE_TIME", serdeConstants.DECIMAL_TYPE_NAME,"旧交易时间"),
    SP_CODE("SP_CODE", serdeConstants.STRING_TYPE_NAME,"SP企业代码"),
    SERVICE_CODE("SERVICE_CODE", serdeConstants.STRING_TYPE_NAME,"业务编码"),
    BAL_PROP("BAL_PROP", serdeConstants.STRING_TYPE_NAME,"结算比例"),
    BILL_FLAG("BILL_FLAG", serdeConstants.STRING_TYPE_NAME,"扣费类型"),
    CONTENT_ID("CONTENT_ID", serdeConstants.STRING_TYPE_NAME,"内容编码"),
    POINT_COST("POINT_COST", serdeConstants.STRING_TYPE_NAME,"点数"),
    VISIT_PROV("VISIT_PROV", serdeConstants.STRING_TYPE_NAME,"用户拜访地省代码"),
    DEPOSIT_TYPE("DEPOSIT_TYPE", serdeConstants.STRING_TYPE_NAME,"操作来源"),
    APPLY_TIME("APPLY_TIME", serdeConstants.STRING_TYPE_NAME,"应用申请时间"),
    FINISH_TIME("FINISH_TIME", serdeConstants.STRING_TYPE_NAME,"结束时间"),
    READ_CONTENT_TYPE("READ_CONTENT_TYPE", serdeConstants.STRING_TYPE_NAME,"内容类型"),
    MSISDN_REC("MSISDN_REC", serdeConstants.STRING_TYPE_NAME,"接收方MSISDN"),
    DURATION("DURATION", serdeConstants.STRING_TYPE_NAME,"业务时长"),
    BYTE_SIZE("BYTE_SIZE", serdeConstants.STRING_TYPE_NAME,"下载内容的大小"),
    MEMBER_TYPE("MEMBER_TYPE", serdeConstants.STRING_TYPE_NAME,"咪咕用户内容"),
    CP_CODE("CP_CODE", serdeConstants.STRING_TYPE_NAME,"提供媒体内容的CP的企业代码"),
    USER_TYPE("USER_TYPE", serdeConstants.STRING_TYPE_NAME,"计费号码用户类型"),
    CRM_RESULT_CODE("CRM_RESULT_CODE", serdeConstants.STRING_TYPE_NAME,"省返回码"),
    RESULT_CODE("RESULT_CODE", serdeConstants.STRING_TYPE_NAME,"交易应答码"),
    RESULT_DESC("RESULT_DESC", serdeConstants.DECIMAL_TYPE_NAME,"交易结果描述"),
    NOTIFY_TYPE("NOTIFY_TYPE", serdeConstants.STRING_TYPE_NAME,"通知类型");

   /*列名*/
   private String columnName;
   /*列类型*/
   private String columnType;
   /*字段描述*/
   private String comment;

   private OnLineChargingColumnEnum(String columnName, String columnType, String comment){
       this.columnName=columnName;
       this.columnType=columnType;
       this.comment=comment;
   }

   /*获取所有的枚举值得kv*/
   public static Map<String,String> getAllColumnField(){
       Map<String,String> cloumnField=new HashMap<String, String>();
        for(OnLineChargingColumnEnum _enum:values()){
            cloumnField.put(_enum.columnName,_enum.columnType);
        }
        return cloumnField;
   }

   /*获取所有列名称*/
   public  static List<String> getAllColumnName(){
       List<String> names=new ArrayList<String>();
       for(OnLineChargingColumnEnum _enum:values()){
           names.add(_enum.columnName);
       }
       return names;
   }
}
